<!--
 * @Date: 2020-07-10 14:37:16
 * @LastEditors: leehave
 * @LastEditTime: 2020-08-24 17:30:09
--> 
<template>
  <div class="footer-tab">
    <div class="footer-bottom">
      <div class="footer-item" :class="[{'big':item.id == 0, 'active': item.active}]" v-for="item in tabList" :key="item.id" @click="changeFootTab(item)">
        <div class="icon">
          <img :src="item.activeIcon" v-if="item.active" alt srcset />
          <img :src="item.icon" v-else alt srcset />
        </div>
        <div class="text">{{item.name}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapGetters } from 'vuex';
export default {
  props: {},
  data() {
    return {
      // tabList: staticPath.tab
    };
  },
  computed: {
    ...mapGetters(['tabList'])
    
  },
  created() {
    console.log(this.tabList,'tabList')
  },
  mounted() {},
  watch: {},
  methods: {
    changeFootTab(item){
      this.$store.commit('app/tabActive',item)
    }
  },
  components: {}
};
</script>

<style lang="less">
.footer-tab {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  background-color: #fff;
  box-shadow: 0 0 8px 2px #e5e5e5;
  .footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    .footer-item {
      flex: 1;
      text-align: center;
      font-size: 16px;
      img {
        width: 24px;
        height: 24px;
      }
      .text {
        font-size: 12px;
        margin-top: 5px;
        color: #afaeae;
      }
      .icon{
        width: 40px;
        height: 30px;
        margin: 0 auto;
        padding-top: 6px;
      }
      // &.big {
      //   .icon{
      //     padding-top: 0;
      //   }
      //   &::before {
      //     content: "";
      //     position: absolute;
      //     left: 50%;
      //     width: 60px;
      //     height: 60px;
      //     background-color: #fff;
      //     border-radius: 50%;
      //     margin-top: -20px;
      //     box-shadow: 0 -10px 10px -5px #e5e5e5;
      //     transform: translateX(-50%);
      //     z-index: -1;
      //   }
      //   img {
      //     width: 40px;
      //     height: 40px;
      //     margin-top: -13px;
      //     border-radius: 50%;
      //     box-shadow: 0 0 10px 4px #f4f4f4;
      //   }
      // }
      &.active{
        .text{
          color: #4ECE40;
        }
      }
    }
  }
}
</style>
